package com.taosdata.example.springbootdemo.controller;

import com.taosdata.example.springbootdemo.domain.Weather;
import com.taosdata.example.springbootdemo.service.IWeatherService;
import com.taosdata.example.springbootdemo.service.impl.WeatherServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RequestMapping("/weather")
@RestController
public class WeatherController {

    @Autowired
    private IWeatherService weatherService;

    @GetMapping("/all")
    public List<Weather> all() {
        return weatherService.all();
    }

    @GetMapping("/add")
    public String add1w() {
        return weatherService.add1w();
    }

    @GetMapping("/findOne")
    public Weather findOne() {
        return weatherService.findOne();
    }
}
